< previous page page_92 next page >

Page 92
For the rest of the project, comment out the Validate event code and the Reposition event code. Now you'll concentrate on adding additional Visual Basic bound controls to the project.
The Bound Text Control and the Bound Label Control
There are no database-related methods or events associated with the bound text control or bound label control. And there are only two properties of the bound text control and the bound label control that are database related:
· DataSource
· DataField
The DataSource property is the name of the data control that maintains the link between the data table and the text or label control. The DataField property identifies the actual field in the data control Dynaset to which the text box or label control is bound. You cannot set the DataSource property at runtimeit's a design time-only property. You can, however, set the DataField property at either runtime or design time.
Bound text controls give you the ability to add input fields to your data forms that automatically link to the Dynaset defined in the data control. Bound label controls are handy when you want to display information without letting users update it. You've already added a bound text control to the project, so now add a bound label control, too.
You'll add the label control to display the AuID (the author ID) field of the Authors table. This will give users the chance to see the author ID but not update it. Add a label control to the form, and set its DataSource property to Data1. Also, set the BorderStyle property to Fixed Single to make it look similar to a text box control. Refer to Figure 4.7 for positioning and placement.
0092-01.jpg
Figure 4.7.
Adding the bound label control.

 
< previous page page_92 next page >

If you like this book, buy it!